using System.Linq; string str = list.Aggregate((x, y) => x + ',' + y);
input.SelectMany(l => l).Distinct().ToList();